package user.zc.exception;

import java.util.List;

public interface Assert {
    ExcelException newException(Object... var1);

    ExcelException newException(Throwable var1, Object... var2);

    default void assertNotEmpty(List list){
        if(list==null || list.size()==0){
            throw this.newException(list);
        }
    }
    default void assertNotNull(Object obj) {
        if (obj == null) {
            throw this.newException(obj);
        }
    }

    default void assertNull(Object obj) {
        if (obj != null) {
            throw this.newException(obj);
        }
    }

    default void assertNotNull(Object obj, Object... args) {
        if (obj == null) {
            throw this.newException(args);
        }
    }

    default void assertIsTrue(Boolean flag) {
        if (!flag) {
            throw this.newException(flag);
        }
    }
}
